package cn.gxufe.reliable.message.admin.domain;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;

import java.util.Date;

import static cn.gxufe.reliable.message.common.Message.STATUS_CONFIRM;
import static cn.gxufe.reliable.message.common.Message.STATUS_FINISH;

/**
 * @author yingjie.rong
 **/
@TableName("message")
public class RMessage implements java.io.Serializable{

    public static final int STATUS_TRY_FINISH = STATUS_CONFIRM + STATUS_FINISH;

    @TableId(type = IdType.AUTO)
    private Long id;
    @TableField
    private String key;
    @TableField
    private String data;

    @TableField("finish_data")
    private String finishData;

    @TableField
    private String header;
    @TableField("source_service")
    private String sourceService;
    @TableField("target_service")
    private String targetService;


    @TableField
    private int status;

    @TableField("prepare_time")
    private Date prepareTime;
    @TableField("confirm_time")
    private Date confirmTime;
    @TableField("send_time")
    private Date sendTime;
    @TableField("finish_time")
    private Date finishTime;
    @TableField("cancel_time")
    private Date cancelTime;

    @TableField("try_send")
    private Integer trySend = 0;

    @TableField("try_confirm")
    private Integer tryConfirm  = 0;

    @TableField("try_finish")
    private Integer tryFinish = 0;

    @TableField("is_done")
    private Integer isDone;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getKey() {
        return key;
    }
    public void setKey(String key) {
        this.key = key;
    }

    public String getData() {
        return data;
    }
    public void setData(String data) {
        this.data = data;
    }

    public String getHeader() {
        return header;
    }

    public void setHeader(String header) {
        this.header = header;
    }

    public String getSourceService() {
        return sourceService;
    }

    public void setSourceService(String sourceService) {
        this.sourceService = sourceService;
    }


    public Integer getTrySend() {
        return trySend;
    }

    public void setTrySend(Integer trySend) {
        this.trySend = trySend;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }


    public String getTargetService() {
        return targetService;
    }

    public void setTargetService(String targetService) {
        this.targetService = targetService;
    }

    public Integer getTryConfirm() {
        return tryConfirm;
    }

    public void setTryConfirm(Integer tryConfirm) {
        this.tryConfirm = tryConfirm;
    }

    public Integer getTryFinish() {
        return tryFinish;
    }

    public void setTryFinish(Integer tryFinish) {
        this.tryFinish = tryFinish;
    }


    public Integer getIsDone() {
        return isDone;
    }

    public void setIsDone(Integer isDone) {
        this.isDone = isDone;
    }


    public String getFinishData() {
        return finishData;
    }

    public void setFinishData(String finishData) {
        this.finishData = finishData;
    }


    public Date getPrepareTime() {
        return prepareTime;
    }

    public void setPrepareTime(Date prepareTime) {
        this.prepareTime = prepareTime;
    }

    public Date getConfirmTime() {
        return confirmTime;
    }

    public void setConfirmTime(Date confirmTime) {
        this.confirmTime = confirmTime;
    }

    public Date getSendTime() {
        return sendTime;
    }

    public void setSendTime(Date sendTime) {
        this.sendTime = sendTime;
    }

    public Date getFinishTime() {
        return finishTime;
    }

    public void setFinishTime(Date finishTime) {
        this.finishTime = finishTime;
    }

    public Date getCancelTime() {
        return cancelTime;
    }

    public void setCancelTime(Date cancelTime) {
        this.cancelTime = cancelTime;
    }
}